const { addComment, getComment } = require('../dao/modules/commentsDao');


//新增评论

module.exports.addComment = async (val) => {
    const data = await addComment(val);
    if (data._id) {
        return {
            status: 1,
            message: '新增评论成功',
            data
        }
    } else {
        return {
            status: 0,
            message: '新增评论失败',
            data
        }
    }
}


//获取评论

module.exports.getComment = async (val) => {
    const data = await getComment(val);
    if (data.length) {
        return {
            status: 1,
            message: '获取评论成功',
            data
        }
    } else {
        return {
            status: 0,
            message: '获取评论失败',
            data
        }
    }
}